<div ng-if="currentTab.type=='todo'">
    <div ng-controller="todoCtrl">
        <div class="mt10 clearfix">
            <span class="f14 fl h30 lh30">状态：</span>
            <div class="fl select w150"
                 ui-combobox
                 data="status"
                 ng-model="Page.filter.status"
                 text-field="text"
                 value-field="value">
            </div>
            <span class="f14 fl h30 lh30 ml10">发起时间：</span>
            <div class="fl">
                <input type="text" class="input-text input-data fl" readonly="" id="start_date" ui-date=""
                       format="yyyy-MM-dd" max-date="#F{$dp.$D(\'end_date'\)}" ng-model="Page.filter.delivery_start_time">
                <span class="fl lh30">&nbsp;&nbsp;-&nbsp;&nbsp;</span>
                <input type="text" class="input-text input-data fl" readonly="" id="end_date" ui-date=""
                       format="yyyy-MM-dd" min-date="#F{$dp.$D(\'start_date'\)}" ng-model="Page.filter.delivery_end_time">
            </div>
            <div class="process-center-search">
                <input type="text" class="input-text fl ml10 w215"
                       ng-enter="search()"
                       placeholder="公司名称、申请人"
                       ng-model="Page.filter.keyword">
                <a class="btn ml10 fl" ng-click="search()">搜索</a>
            </div>
        </div>
        <div class="table-responsive mt10" style="overflow-x:visible;" ng-controller="stockOutCtrl">
            <table class="table table-hover">
                <thead>
                <tr>
                    <th class="w40 text-center">序号</th>
                    <th class="w360">流程名称</th>
                    <th class="w150">发起时间</th>
                    <th class="w150">确认时间</th>
                    <th class="w80">状态</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="row in Page.rows">
                    <td class="text-center">{{ $index + 1 }}</td>
                    <td>{{row.name}}</td>
                    <td>{{row.createdOn}}</td>
                    <td>{{row.confirmTime}}</td>
                    <td>{{row.currentStep}}</td>
                    <td>
                        <a class="mr5"
                           ui-dialog="申请详情"
                           ui-dialog-template="{{stockOutTpl}}"
                           ui-dialog-before-show="warpViewPromise(row, $dialog, $dialogScope, $data)(beforeStockOutShow)">
                            查看</a>
                        <a class="mr5"
                           ng-if="row.canRollback===1"
                           ui-dialog="回退"
                           ui-dialog-template='<div style="width: 400px;">回退出库单"{{row.name}}"?</div>'
                           ui-dialog-ok="orderHt(row.deliveryGuid)">回退</a>
                        <a i-id="create_tenant"
                           ui-dialog="新增租户"
                           ui-dialog-template="{{createTenantTpl}}"
                           ui-dialog-before-show="warpViewPromise(row, $dialog, $dialogScope)(beforeCreateTenantShow)"
                           ui-dialog-ok="createTenant($data)"
                           ng-show="row.isNewOrg === '1' && row.currentStep === '已确认'">新增租户
                        </a>
                        <a i-id="create_auth"
                           ui-dialog="新增授权"
                           ui-dialog-template="{{createAuthTpl}}"
                           ui-dialog-before-show="warpViewPromise(row, $dialog, $dialogScope)(beforeCreateAuthShow)"
                           ui-dialog-ok="createAuth($data, row.orgId)"
                           ng-show="!(row.isNewOrg === '1' && row.currentStep === '已确认')">新增授权
                        </a>
                        <a class="mr5"
                           ui-dialog="审批记录"
                           ui-dialog-template="{{stepsTpl}}"
                           ui-dialog-before-show="beforeStepsShow(row, $dialog, $dialogScope)">审批记录</a>
                    </td>
                </tr>
                </tbody>
            </table>
            <div class="no-data" ng-hide="Page.rows.length"><span>暂无数据</span></div>
        </div>
        <div ui-pagination=""
             page-index="Page.pagination.params[Page.pageIndexName]"
             total="Page.pagination.total"
             page-size="Page.pagination.params[Page.pageSizeName]"
             changed="Page.pagination.change($pageIndex, Page.pagination.params[Page.pageSizeName])">
        </div>
    </div>
</div>
